package test.test1;

public class Rectangle extends Shape{
    private double length;
    private double wide;

    public Rectangle() {
    }

    public Rectangle(double length, double wide) {
        this.length = length;
        this.wide = wide;
    }

    @Override
    public double getArea() {
        return length*wide;
    }

    @Override
    public double getPerimeter() {
        return 2*length+2*wide;
    }

    /**
     * 获取
     * @return length
     */
    public double getLength() {
        return length;
    }

    /**
     * 设置
     * @param length
     */
    public void setLength(double length) {
        this.length = length;
    }

    /**
     * 获取
     * @return wide
     */
    public double getWide() {
        return wide;
    }

    /**
     * 设置
     * @param wide
     */
    public void setWide(double wide) {
        this.wide = wide;
    }

    public String toString() {
        return "Rectangle{length = " + length + ", wide = " + wide + "}";
    }
}
